Skip to content

Conversation

heyitsaamir
Copy link
Collaborator

@heyitsaamir heyitsaamir commented Sep 4, 2025

This PR:

  1. Adds a mcp server integration to the MCP package (so now you can make your teams applications MCP servers as well)
  2. It uses FastMCP underneath. Mounts the FastMCP server to our regular FastAPI server.
  3. Moved mcp test to mcp-client
Screen.Recording.2025-09-06.at.8.11.26.AM.mov

PR Dependency Tree

This tree was auto-generated by Charcoal

heyitsaamir added a commit that referenced this pull request Sep 4, 2025
Add support for OpenAI Responses API.
1. Adds a new OpenAI Model to itneract with Responses API
2. Move completions to its own file
3. Responses has a stateful and a stateless API. In this PR i have
support for both. (not streaming yet tho)
4. Responses stateful, required me to save the last message from the
model, so i had to make some minor changes to the ListStorage api.
















#### PR Dependency Tree


* **PR #120** 👈
  * **PR #121**
    * **PR #123**
      * **PR #126**

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
heyitsaamir added a commit that referenced this pull request Sep 4, 2025
Adds lifecycle methods for ChatPrompt which add support for AI Plugins.
This is needed to add plugins to augment the operation of the chat
prompt.













#### PR Dependency Tree


* **PR #121** 👈
  * **PR #123**
    * **PR #126**

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
@heyitsaamir heyitsaamir force-pushed the aamirj/mcp-server branch 2 times, most recently from a8762dd to 91ebf26 Compare September 5, 2025 05:49
@heyitsaamir heyitsaamir force-pushed the aamirj/mcp-server branch 2 times, most recently from e44e505 to 4e60026 Compare September 6, 2025 01:02
@heyitsaamir heyitsaamir marked this pull request as ready for review September 6, 2025 15:12
@heyitsaamir heyitsaamir force-pushed the aamirj/mcp-server branch 2 times, most recently from 595b78b to 2f41d30 Compare September 6, 2025 21:08
Copy link
Collaborator

@lilyydu lilyydu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks awesome!!

@heyitsaamir heyitsaamir force-pushed the aamirj/mcp-server branch 2 times, most recently from 60af9e2 to 5af9496 Compare September 8, 2025 21:11
heyitsaamir added a commit that referenced this pull request Sep 8, 2025
Adds support for MCP clients in an MCP plugin. Makes use of the AI
plugin system introduced in #121 .

- Added new MCP package (packages/mcp/) with AI plugin and transport
functionality
  - Updated chat prompt handling for MCP integration
- Changed token from being parsed into JWT tokens because that's not
necessarily true for many types of tokens. Github for eg, doesn't use
JWT.

This is roughly how the system works:
```mermaid
sequenceDiagram
      participant U as User
      participant CP as ChatPrompt
      participant P as MCP Plugin
      participant MCP as MCP Server
      participant M as AI Model

      U->>CP: send(input)

      CP->>P: on_build_functions(functions)
      P->>MCP: get_available_tools()
      MCP-->>P: tool_definitions
      P-->>CP: functions + mcp_tools

      CP->>M: generate_text(input, system, functions)

      alt Model calls MCP tool
          M-->>CP: function_call(mcp_tool, params)
          CP-->>M: function_result
      end

      M-->>CP: response
      CP-->>U: ChatSendResult
```






















#### PR Dependency Tree


* **PR #123** 👈
  * **PR #126**

This tree was auto-generated by
[Charcoal](https://github.com/danerwilliams/charcoal)
Base automatically changed from aamirj/mcp to main September 8, 2025 21:13
@Copilot Copilot AI review requested due to automatic review settings September 8, 2025 21:19
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds MCP (Model Context Protocol) server capabilities to the Teams SDK, allowing Teams applications to expose their functions as MCP tools for consumption by other MCP clients.

  • Implements McpServerPlugin that wraps FastMCP to provide MCP server functionality
  • Integrates the MCP server with existing FastAPI infrastructure through HTTP plugin mounting
  • Restructures test projects to separate MCP client and server examples

Reviewed Changes

Copilot reviewed 9 out of 13 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
packages/mcp/src/microsoft/teams/mcp/server_plugin.py Core MCP server plugin implementation with FastMCP integration
packages/mcp/src/microsoft/teams/mcp/__init__.py Exports new McpServerPlugin class
packages/mcp/pyproject.toml Adds FastMCP dependency and updates package references
packages/apps/src/microsoft/teams/apps/http_plugin.py Adds lifespan management for mounting additional applications
packages/apps/src/microsoft/teams/apps/plugins/metadata.py Improves type annotations for Plugin decorator
tests/mcp-server/src/main.py Example MCP server implementation with weather and calculator tools
tests/mcp-server/pyproject.toml Project configuration for MCP server test
tests/mcp-client/pyproject.toml Renames test project from "mcp-test" to "mcp-client"
README.md Documents the new MCP package in the SDK overview

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@heyitsaamir heyitsaamir merged commit 2d1d985 into main Sep 8, 2025
6 checks passed
@heyitsaamir heyitsaamir deleted the aamirj/mcp-server branch September 8, 2025 21:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants